<?php

namespace App\Transformers\Teacher;

use League\Fractal\TransformerAbstract;
use App\Models\Teacher\Study;

class StudyTransformer extends TransformerAbstract
{

    public function transform(Study $model)
    {
        return [
            'id'         => (int) $model->id,
            'teacher_id'=> $model->teacher_id,
            'sponsor'=> $model->sponsor,
            'content'=> $model->content,
            'score'=> $model->score,
            'start_date'=> $model->start_date,
            'finish_date'=> $model->finish_date,
            'remark'=> $model->remark,
            'created_user'=> $model->created_user,
            'updated_user'=> $model->updated_user,
            'created_at' => $model->created_at->format('Y-m-d H:i:s'),
            'updated_at' => $model->updated_at->format('Y-m-d H:i:s')
        ];
    }
}
